package com.netrust.cmsx.entity.module.cms;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;


/**
 * 文章内容表
 * @author Administrator
 *
 */
@Entity
@Table(name="t_article_contents")
public class ArticleContents {
	
    private Integer id;//

    private String contents;//文章内容
    
    private String aid;//文章id
    
    //private Article article;
	public ArticleContents() {
		super();
	}
	public ArticleContents(Integer id) {
		super();
		this.id = id;
	}
	public ArticleContents(Integer id,String contents) {
		super();
		this.id = id;
		this.contents = contents;
	}
	
	/*public ArticleContents(Integer id, String contents, Article article) {
		super();
		this.id = id;
		this.contents = contents;
		this.article = article;
	}*/
	@Id
  	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ac_id", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@JsonIgnore
	@Column(name = "ac_contents")
	public String getContents() {
		return contents;
	}

	public void setContents(String contents) {
		this.contents = contents;
	}
	
	@JsonIgnore
	@Column(name = "ac_aid")
	public String getAid() {
		return aid;
	}
	public void setAid(String aid) {
		this.aid = aid;
	}
	
	/*@OneToOne(mappedBy="articleContents",fetch=FetchType.LAZY)  
	public Article getArticle() {
		return article;
	}
	public void setArticle(Article article) {
		this.article = article;
	}*/
	@Override
	public String toString() {
		return "ArticleContents [id=" + id + ", contents=" + contents + ", aid=" + aid + "]";
	}
    
}